home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / usr_-_Usr_Files / INCLUDE / APM.H < prev    next >
C/C++ Source or Header  |  1999-09-17  |  2KB  |  62 lines

  1. /* apm.h -- Header file for sample APM interface routines
  2.  * Created: Mon Jan  8 11:40:50 1996 by r.faith@ieee.org
  3.  * Revised: Thu Apr  4 21:57:31 1996 by r.faith@ieee.org
  4.  * Copyright 1996 Rickard E. Faith (r.faith@ieee.org)
  5.  *
  6.  * This library is free software; you can redistribute it and/or modify it
  7.  * under the terms of the GNU Library General Public License as published
  8.  * by the Free Software Foundation; either version 2 of the License, or (at
  9.  * your option) any later version.
  10.  * 
  11.  * This library is distributed in the hope that it will be useful, but
  12.  * WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  14.  * Library General Public License for more details.
  15.  * 
  16.  * You should have received a copy of the GNU Library General Public
  17.  * License along with this library; if not, write to the Free Software
  18.  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  * 
  20.  * $Id: apm.h,v 1.4 1996/04/05 03:20:38 faith Exp $
  21.  * 
  22.  */
  23.  
  24. #include <linux/apm_bios.h>
  25. #include <sys/types.h>
  26.  
  27. #define APM_PROC   "/proc/apm"
  28. #define APM_DEVICE "/dev/apm_bios"
  29.  
  30. #define APM_DEV  "/proc/devices"
  31. #define APM_NAME "apm_bios"
  32.  
  33. #ifndef APM_32_BIT_SUPPORT
  34. #define APM_32_BIT_SUPPORT      0x0002
  35. #endif
  36.  
  37. typedef struct apm_info {
  38.    const char driver_version[10];
  39.    int        apm_version_major;
  40.    int        apm_version_minor;
  41.    int        apm_flags;
  42.    int        ac_line_status;
  43.    int        battery_status;
  44.    int        battery_flags;
  45.    int        battery_percentage;
  46.    int        battery_time;
  47.    int        using_minutes;
  48. } apm_info;
  49.  
  50. extern int   apm_exists( void );
  51. extern int   apm_read( apm_info *i );
  52. extern dev_t apm_dev( void );
  53. extern int   apm_open( void );
  54. extern int   apm_close( int fd );
  55. extern int   apm_get_events( int fd, int timeout, apm_event_t *events, int n );
  56. extern int   apm_suspend( int fd );
  57. extern int   apm_standby( int fd );
  58. extern const char *apm_event_name( apm_event_t event );
  59. extern const char *apm_time( time_t t );
  60. extern const char *apm_delta_time( time_t then, time_t now );
  61. extern const char *apm_time_nosec( time_t t );
  62.